import request from "@/utils/request";
//列表

import { AsyncMenuData } from "@/config/async.router.config";
const index = () => {
  return new Promise(resolve => {
    resolve({
      ...AsyncMenuData
    });
  });
};
//添加
const add = params => {
  return request({
    url: "/admin/system.Menu/add",
    method: "post",
    data: params
  });
};
//添加
const detail = params => {
  return request({
    url: "/admin/system.Menu/detail",
    method: "post",
    data: params
  });
};
//编辑
const edit = params => {
  return request({
    url: "/admin/system.Menu/edit",
    method: "post",
    data: params
  });
};
//删除
const del = params => {
  return request({
    url: "/admin/system.Menu/del",
    method: "post",
    data: params
  });
};

//删除
const auth_menu = params => {
  return request({
    url: "/admin/system.Role/auth_menu",
    method: "post",
    data: params
  });
};

//权限
const getPermit = params => {
  return request({
    url: "/api/v1/interface/dynamic",
    method: "get",
    data: params
  });
};

export default {
  index,
  add,
  detail,
  edit,
  del,
  auth_menu,
  getPermit
};
